package com.sxl.chapter.night;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

//		byte[] b = new byte[4];
//		int[] a = {0,0,2,9};
//		int sum = 0;
//		int len = 2;
//		for (int i =0; i< a.length; i++) {
//			int b = a[i] & 0xff;
//			System.out.println(b);
//			b <<= (--len)*8;
//			System.out.println(b);
//			sum = b+sum;
//		}
//		System.out.println(sum);
		
		try {
			InputStream is = new FileInputStream("F:\\workspace\\JVM\\bin\\com\\sxl\\Hello.class");
//			InputStream is = new FileInputStream("F:\\workspace\\JVM\\bin\\com\\sxl\\chapter\\night\\DynamicProxyTest.class");
			byte[] b = new byte[is.available()];
			is.read(b);
			is.close();
			System.out.println(b.toString());
			System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
			System.out.println(JavaClassExecuter.execute(b));
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
